#include<stdio.h>
void main (void)
{
	int a=10, b=15, n=5, sum;
	sum = function1 (a,b,n);
	printf ("\n\n The end result is sum = %d \n", sum);
}
int function1 (int i, int j, int k)
{
	int tot;
	k--;
	if (k != 0)
	{
		printf ("Values in phase 1 - calling phase\n"
		        " i = %d  j = %d  k = %d  tot = %d \n", i,j,k,tot);
		tot = (i+j) + function1 (i,j,k)  ;
		printf ("Values in phase 2 - returning phase\n"
		        " i = %d  j = %d  k = %d  tot = %d \n", i,j,k,tot);
		return (tot);
	}
	else
	{
		tot = i+j;
		printf ("Values at reversal\n"
		        " i = %d  j = %d  k = %d  tot = %d \n", i,j,k,tot);
		return (tot);
	}
}



